package com.bosch.in.rtp1.ept.action.form;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts.action.ActionForm;

import com.bosch.in.rtp1.ept.constant.SkippedRecipeConstanst;
import com.bosch.in.rtp1.ept.model.dto.SelectingInt;

/**
 * Class is used to store parameters which are conditions to set the skipped finished recipes
 * @author LIV1HC
 *
 */

public class SkippedRecipeConditionForm extends ActionForm{
	
	private static final long serialVersionUID = 1L;
	
	private float baseLeadTime;
	private float runTime;
	private float waitTime;
	private List<SelectingInt> baseLeadTimeOperators;
	private List<SelectingInt> runTimeOperators;
	private List<SelectingInt> waitTimeOperators;
	private int selectedBaseLeadTimeOperator;
	private int selectedRunTimeOperators;
	private int selectedWaitTimeOperators;
	private boolean applyForAll;
	
	private String lastModified;
	
	public float getBaseLeadTime() {
		return baseLeadTime;
	}
	
	public void setBaseLeadTime(float baseLeadTime) {
		this.baseLeadTime = baseLeadTime;
	}
	
	public float getRunTime() {
		return runTime;
	}
	
	public void setRunTime(float runTime) {
		this.runTime = runTime;
	}
	
	public float getWaitTime() {
		return waitTime;
	}
	
	public void setWaitTime(float waitTime) {
		this.waitTime = waitTime;
	}
	
	public List<SelectingInt> getBaseLeadTimeOperators() {
		if (this.baseLeadTimeOperators == null)
		{
			this.baseLeadTimeOperators = this.buildOperators();
		}
		return baseLeadTimeOperators;
	}
	
	public void setBaseLeadTimeOperators(List<SelectingInt> baseLeadTimeOperators) {
		this.baseLeadTimeOperators = baseLeadTimeOperators;
	}
	
	public List<SelectingInt> getRunTimeOperators() {
		if (this.runTimeOperators == null)
		{
			this.runTimeOperators = this.buildOperators();
		}
		return runTimeOperators;
	}
	
	public void setRunTimeOperators(List<SelectingInt> runTimeOperators) {
		this.runTimeOperators = runTimeOperators;
	}
	
	public List<SelectingInt> getWaitTimeOperators() {
		if (this.waitTimeOperators == null)
		{
			this.waitTimeOperators = this.buildOperators();
		}
		return waitTimeOperators;
	}
	
	public void setWaitTimeOperators(List<SelectingInt> waitTimeOperators) {
		this.waitTimeOperators = waitTimeOperators;
	}
	
	public int getSelectedBaseLeadTimeOperator() {
		return selectedBaseLeadTimeOperator;
	}
	
	public void setSelectedBaseLeadTimeOperator(int selectedBaseLeadTimeOperator) {
		this.selectedBaseLeadTimeOperator = selectedBaseLeadTimeOperator;
	}
	
	public int getSelectedRunTimeOperators() {
		return selectedRunTimeOperators;
	}
	
	public void setSelectedRunTimeOperators(int selectedRunTimeOperators) {
		this.selectedRunTimeOperators = selectedRunTimeOperators;
	}
	
	public int getSelectedWaitTimeOperators() {
		return selectedWaitTimeOperators;
	}
	
	public void setSelectedWaitTimeOperators(int selectedWaitTimeOperators) {
		this.selectedWaitTimeOperators = selectedWaitTimeOperators;
	}
	
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	private List<SelectingInt> buildOperators()
	{
		List<SelectingInt> operators = new ArrayList<SelectingInt>();
		for (int i = 0; i< SkippedRecipeConstanst.NUM_OP_OPERATOR ; ++i)
		{
			SelectingInt selectingInt = new SelectingInt();
			selectingInt.setDisplay(SkippedRecipeConstanst.OPERATORS[i]);
			selectingInt.setValue(i);
			operators.add(selectingInt);
		}
		return operators;
	}

	public void setLastModified(String lastModified) {
		this.lastModified = lastModified;
	}

	public String getLastModified() {
		return lastModified;
	}

	public void setApplyForAll(boolean applyForAll) {
		this.applyForAll = applyForAll;
	}

	public boolean isApplyForAll() {
		return applyForAll;
	}
	
}
